package tests;

import junit.framework.TestCase;
import objects.User;
import DB.DB;

public class DBTest extends TestCase {
	DB d=new DB();
	public void testDB() {
		assertTrue(d!=null);
	}

	public void testAddForum() {
		d.addForum("Asaf");
		assertEquals(d.get_forum().get(0).getNameOfFourm(), "Asaf");
		
	}

	public void testAddThreadToFroum() {
		d.addForum("Asaf");
		d.addThreadToFroum("Asaf", "Manassen");
		assertEquals(d.getThreads("Asaf").get(0).get_nameOfThread(), "Manassen");
		
	}



	public void testRemoveUser()
	{
		User u=new User("Asaf");
		d.addUser(u);
		
		d.removeUser(u);
		assertEquals(d.getUsers().size(),0 );
		
	}
	/*
	public void testfindOwnerOfMessage()
	{
		fail();
	}
	public void testremoveMessage()
	{
		fail();
	}
	*/
}
